{extends file="assets::smarty-templates::Master"|ToPath}
{block name=content}

<form action="{$action}" method="POST" class="form-validate">
    <fieldset>
    <label>Notas :: Periodo {$periodos[$indexPeriodo]->getPeriodo()} de {$periodos[$indexPeriodo]->getAno()}</label>
    Seleccionar otro periodo
    <select name="IndexPeriodo" id="index-periodo">
        {foreach $periodos as $periodo}
        <option value="{$periodo@iteration - 1}"
                {if $indexPeriodo == $periodo@iteration - 1}
                selected="selected"
                {/if}>
            {$periodo->getAno()} - {$periodo->getPeriodo()}
        </option>
        {/foreach}
    </select>
    <input type="submit" value="" id="submit" style="display: none;"/>

<div class="clear"></div>
<hr/>
<table class="normal tablesorter">
    <thead>
        <tr>
            <th class="header">Cr&eacute;ditos</th>
            <th class="header">Nombre</th>
            <th class="header">30%</th>
            <th class="header">30%</th>
            <th class="header">40%</th>
            <th class="header">Habilitaci&oacute;n</th>
            <th class="header">Definitiva</th>
        </tr>
    </thead>
    <tbody>
        {foreach $cursos as $curso}
        <tr class="{cycle values="odd, even"}">
            <td>{$curso->getCurso()->getCreditos()}</td>
            <td>{$curso->getCurso()->getMateria()->getNombreMateria()}</td>
            <td>{if $curso->getNota1()!=0}{$curso->getNota1()|string_format:"%.1f"}{else}-{/if}</td>
            <td>{if $curso->getNota2()!=0}{$curso->getNota2()|string_format:"%.1f"}{else}-{/if}</td>
            <td>{if $curso->getNota5()!=0}{$curso->getNota5()|string_format:"%.1f"}{else}-{/if}</td>
            <td>{if $curso->getNotaValidacion()!=0}{$curso->getNotaValidacion()|string_format:"%.1f"}{else}-{/if}</td>
            <td>{if $curso->getNotaDefinitiva()!=0}{$curso->getNotaDefinitiva()|string_format:"%.1f"}{else}-{/if}</td>
        </tr>
        {/foreach}
    </tbody>
</table>
    </fieldset>
</form>

<script type="text/javascript" >
    {literal}
        jQuery.noConflict();
        jQuery("#index-periodo").change(function(){
            jQuery("#submit").click();
        });
    {/literal}
</script>
{/block}